package com.chuangketiebeta.ui;

import android.app.Activity;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.chuangketiebeta.AppManager;
import com.chuangketiebeta.BaseActivity;
import com.chuangketiebeta.MainActivity;
import com.chuangketiebeta.R;


public class SplashActivity extends BaseActivity {
	public static final String TAG = SplashActivity.class.getSimpleName();
	private ImageView mSplashItem_iv;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		findViewById();
		initView();
	}

	@Override
	protected void findViewById() {
		// TODO Auto-generated method stub
		mSplashItem_iv = (ImageView) findViewById(R.id.splash_loading_item);
	}

	@Override
	protected void initView() {
		Animation translate = AnimationUtils.loadAnimation(SplashActivity.this, R.anim.splash_loading);
		translate.setAnimationListener(new AnimationListener() {
			
			@Override
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onAnimationEnd(Animation animation) {
				openActivity(MainActivity.class);
				overridePendingTransition(R.anim.zoomin,
						R.anim.zoomout);
				SplashActivity.this.finish();
				
			}
		});
		mSplashItem_iv.setAnimation(translate);
	
	}

}
